package com.zjut.zs.review.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.util.module.PageModule;
import com.zjut.zs.review.dao.ZsReview;
import com.zjut.zs.review.dao.ZsReviewDAO;


public class ZsReviewManager {

	@Resource(name = "ZsReviewDAO")
	private ZsReviewDAO dao;
	
	public void addData(ZsReview obj) {	
		dao.save(obj);
	}
	
	public void updateData(ZsReview obj) {
		dao.update(obj);
	}
	
	public void deleteData(ZsReview obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<ZsReview> objlist) {
		for (ZsReview ZsReview : objlist) {
			dao.delete(ZsReview);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order, ZsReview obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public int getCountByInstance (ZsReview obj) {
		return dao.countByInstance(obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public ZsReview getData(int objId) {
		return dao.findById(objId);
	}
}
